<%# locals: (user:) %>
<% if Errbit::Config.google_authentication && user == current_user %>
  <span class="google">
    <% if user.google_account? %>
      <%= link_to "Unlink #{Errbit::Config.google_site_title} account",
                  user_unlink_google_path(user),
                  method: :patch,
                  data: { confirm: "Are you sure?" } %>
    <% else %>
      <%= link_to "Link #{Errbit::Config.google_site_title} account",
                  user_google_oauth2_omniauth_authorize_path,
                  method: :post %>
    <% end %>
  </span>
<% end %>
